{% extends "base.html" %}  
{% block title %} 患者列表 {% endblock %}  

{% block content %} 
<div class="container">

    <!-- Docs nav
    ================================================== -->
    <div class="row">
      <div class="span3 bs-docs-sidebar">
        <ul class="nav nav-list bs-docs-sidenav">
         <li><a href="{% url sle.views.list_patient %}"><i class="icon-chevron-right"></i> 患者列表</a></li>
          <li><a href="{% url sle.views.save_patient %}"><i class="icon-chevron-right"></i> 新增记录</a></li>
          <li><a href="{% url sle.views.patients_chart %}"><i class="icon-chevron-right"></i> 综合分析</a></li>
          <li><a href="{% url sle.views.sle_logout %}"><i class="icon-chevron-right"></i> 退出系统</a></li>
        </ul>
      </div>
      

<div class="span9">



        <!-- Tables
        ================================================== -->
        <section id="tables">
          <div class="page-header">
            <h1>患者记录列表</h1>
          </div>
          
           <form action="{% url sle.views.search_patient %}" id="search_form" method="get" >
            <div class="input-append">
              <input type="text" name="q" value="{{ query|escape }}">
              <div class="btn-group">
                <button class="btn" tabindex="-1" disabled="disabled">搜索</button>
                <button class="btn dropdown-toggle" data-toggle="dropdown" tabindex="-1">
                  <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                  <li><a href="#" id="name_s">姓名</a></li>
                  <li><a href="#" id="number_s">登记号</a></li>
                  <li><a href="#" id="PatientNo_s">门诊号</a></li> 
                  <li><a href="#" id="hospitalized_s">住院号</a></li>
                </ul>
              </div>
            </div>
          </form>

       
                   
          <div class="bs-docs-example">
            <table class="table table-hover">
              <thead>
                <tr>
                  
                  <th>登记号</th>
                  <th>姓名</th>
                  <th>性别</th>
                  <th>年龄</th>
                  <th><div align="center">备注</div></th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
              
              {% for item in list_items.object_list %}
                <tr>
                 
                   <td>{{item.patient_number}}</td>
                  <td>{{item.patient_name}}</td>
                  <td>{{item.patient_gender}}</td>
                  <td>{{item.patient_age}}</td>
                 
                  
                  <td>{{item.patient_remark}}</td>
                  <td><a href="{% url sle.views.viewedit_patient item.id %}">查看</a> {% if perms.sle.delete_patient %}/<a href="{% url sle.views.del_patient item.id %}">删除</a> {% endif %}</td>
                </tr>
               
               {% endfor %}
              </tbody>
            </table>
          </div>


        </section>
        
        
            <div class="pagination pagination-right">
              <ul>
              {% if list_items.has_previous %}
    <li><a href="?page={{ list_items.previous_page_number }}">Previous</a>
{% endif %}
</li>
<li>
    <a href='#' onclick="return false;">Page {{ list_items.number }} of {{ list_items.paginator.num_pages }}.</a>
</li>
<li>
{% if list_items.has_next %}
        <a href="?page={{ list_items.next_page_number }}">Next</a>
{% endif %}
</li>

</ul>
            </div>
          

</div>
</div>
</div>
{% endblock %} 

{% block some_js %}

 <script type="text/javascript">
 $(document).ready(function() {
 
 $('#name_s').click(function(){

        $('#search_form').attr("action", "{% url sle.views.search_patient %}").submit();
		
		});
		
 $('#number_s').click(function(){

        $('#search_form').attr("action", "{% url sle.views.search_patient %}").submit();
		
		});
		
 $('#PatientNo_s').click(function(){

        $('#search_form').attr("action", "{% url sle.views.search_PatientNo %}").submit();
		
		});
		
	 $('#hospitalized_s').click(function(){

        $('#search_form').attr("action", "{% url sle.views.search_hospitalized %}").submit();
		
		});
	

 });
 
 
</script>

{% endblock %}